// -----------------------------
// Author: 		Dhaenens Gert	
// Creation: 	10/18/2014 5:34:00 PM				
// -----------------------------

#include "MeshActor.h"

#include "Mesh.h"
#include "DefaultMaterial.h"

MeshActor::MeshActor(const TString& Name)
	: Actor(Name, Actor::Geometry)
	, m_lpMesh(nullptr)
	, m_lpMaterial(nullptr)
{
}

MeshActor::~MeshActor()
{
	NullRelease(&m_lpMesh);
	NullRelease(&m_lpMaterial);
}

void MeshActor::SetMesh(Mesh* lpMesh)
{
	NullRelease(&m_lpMesh);

	m_lpMesh = lpMesh;
	m_lpMesh->AddRef();
}
void MeshActor::SetMaterial(Material* lpMaterial)
{
	NullRelease(&m_lpMaterial);

	m_lpMaterial = lpMaterial;
	m_lpMaterial->AddRef();
}

Mesh* MeshActor::GetMesh() const
{
	return m_lpMesh;
}
Material* MeshActor::GetMaterial() const
{
	return m_lpMaterial;
}